// TOWN DIALOGUE SCRIPT
//    Town 135: Kneece

begintalkscript;

variables;

short i,j,k,r1,choice;

// Purgatos

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Purgatos";
	text1 = "A withered old man watches you carefully from his desk as you approach. He has a pair of wands at his belt, in case you cause trouble.";
	text2 = "You stare at each other awkwardly for a minute. Once you're both sure there isn't about to be a fight, you relax. He scratches his nose thoughtfully and says, _Welcome, person who just broke into my home. I am Purgatos._";
	text5 = "Purgatos says, _What else, intruder?_ He's a little more relaxed, but his hands never stray far from his wands.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_Why do you live in this abandoned town?_";
	text1 = "_I prefer to live in seclusion._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_Why have you chosen a life of seclusion?_";
	text1 = "_I am avoiding the tentacles of the Empire._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_Why did you decide to come here?_";
	text1 = "_The Empire's control is not something I can adjust to, so I had to pick a place far from them. There are few choices. Avernum is too cold for me. This island will do, until the inevitable occurs._";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_The 'control' of the Empire?_";
	text1 = "_The Empire has very strict, very stupid rules for what sorts of magic mages are allowed to perform. I will not allow them to control me._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_If you had to, you could always evade the Empire in Avernum._";
	text1 = "_One is cruel, the other damp. Neither are good choices. This island will do, until the inevitable occurs._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_What inevitable event do you foresee happening?_";
	text1 = "_The Empire will come here someday and suffocate all free thought._ He sighs. _But I know that hearing the complaints of an old man is not the reason you journeyed here._";

begintalknode;
	state = 1;
	nextstate = 6;
	question = "_I have come seeking assistance._";
	text1 = "_News of you precedes you everywhere you go. I can tell you about Kneece, or the Anama, if you wish. But I suspect you are most interested in the problem of the cockroaches._";
	text3 = "_News of you precedes you everywhere you go. I can tell you about Kneece, or the Anama, if you wish. Since you have dealt with the cockroaches, there is little else I can do to help you._";
	action = DEP_ON_SDF 307 5 0;

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_What happened to Kneece?_";
	text1 = "_This city was a magical center before the Anama came to Bigail. Much powerful spellcraft took place here. Then the Anama came, and suddenly our supply shipments started 'disappearing.'_";
	text2 = "_The mages abandoned the place, and a bunch of giant lizards moved in. I'm the only person left here. The solitude suits me._";

begintalknode;
	state = 6;
	nextstate = -1;
	question = "_Can you teach me anything?_";
	text1 = "_No. I just want to say what I must, so that you will go off and be heroes somewhere else._";

begintalknode;
	state = 6;
	nextstate = 7;
	question = "_What do you think of the Anama?_";
	text1 = "_The ruination of Kneece was their fault. I despise them. Avoid them if at all possible. By the way, they have a huge treasure in their temple somewhere. I hope someone steals it._";
	text3 = "He notes your Anama rings, looks at you with distaste, and remains silent.";
	code =
		if (has_spec_item(40) == 0)
			remove_string(3);
			else remove_string(1);
	break;

begintalknode;
	state = 7;
	nextstate = 6;
	condition = has_spec_item(40) <= 0;
	question = "_We might just help ourselves to that treasure._";
	text1 = "He grins wickedly. _You didn't hear that from me._";

begintalknode;
	state = 6;
	nextstate = 8;
	question = "_What do you know of the cockroach plague?_";
	text1 = "_I do a bit of scrying and ethereal wandering. I know how the monsters are created. There's a small difficulty, though._";
	text3 = "He shrugs. _There is still a problem, but it's not yours to solve. You've done what you can. I suggest moving on._";
	action = DEP_ON_SDF 307 5 0;

begintalknode;
	state = 8;
	nextstate = 9;
	condition = gf(307,5) == 0;
	question = "_How are the cockroaches being created?_";
	text1 = "_The cockroaches are being made in a huge underground factory, which creates filth for them to grow in and eat before they go out to cause havoc. The Filth Factory is hidden somewhere on the Isle of Bigail._";
	text2 = "_Therein lies the main difficulty._";

begintalknode;
	state = 9;
	nextstate = -1;
	question = "_Where is the Filth Factory?_";
	text1 = "_I have put a good deal of effort into finding out, and still I have no idea._";

begintalknode;
	state = 9;
	nextstate = 1;
	condition = gf(307,5) <= 0;
	question = "_What difficulty?_";
	text1 = "_Recently, someone came to me asking for help destroying the factory. Don't ask for more details. I couldn't give aid then. Now, after a lot of work, I can aid you, as this person requested._";
	text2 = "_I have developed a device which I believe could destroy the factory. However, this would only be useful if the place was found. If you found it, I would make the device a gift to you._";
	code =
		sf(135,11,1);
		toggle_quest(110,1);
	break;

	
begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(135,11) >= 1 && gf(307,5) == 0;
	question = "_You told me of a device you developed to deal with the roach factory. Can I have it?_";
	code =
		run_hardcode(134);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(307,5) > 0;
	question = "_The cockroaches have been destroyed._";
	text1 = "_Good. I am glad I made it possible. Not that the Anama would ever give me credit._";

// Faithful

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 40;
	question = "Faithful";
	text1 = "You notice that this lizard wears a small chain around its neck. It stares at you. Then it startles you by beginning to speak. _I'm called Faithful._";
	text5 = "Faithful looks up at you. _Hiss. What else do you want? Hiss._";
	action = INTRO;

begintalknode;
	state = 40;
	nextstate = 41;
	question = "_How is it that you can speak?_";
	text1 = "_I'm a familiar._";

begintalknode;
	state = 41;
	nextstate = 42;
	question = "_What is a familiar?_";
	text1 = "It speaks in a calm, patient, surprisingly hiss-free voice. _I'm a magical, long-lived, intelligent animal guardian to Purgatos. It takes up most of my time. Oh. And I hiss._";

begintalknode;
	state = 42;
	nextstate = -1;
	question = "_Purgatos?_";
	text1 = "_My wise and all-powerful master._";

begintalknode;
	state = 42;
	nextstate = 43;
	question = "_Is it boring for you?_";
	text1 = "_Yes. I have a hobby._";

begintalknode;
	state = 43;
	nextstate = 44;
	question = "_What's your hobby?_";
	text1 = "_I go out and chat with the other lizards._";

begintalknode;
	state = 44;
	nextstate = -1;
	question = "_What do you speak about?_";
	text1 = "_This island has many, many giant lizards on it. I'm not sure why. It makes little sense. But they make good conversation. They know a great deal about the weather, which stones are best for basking on, and where to find the tastiest meat._";

